﻿using NHibernate.Mapping.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceZero.DataStore.Models
{
    /// <summary>
    /// 操作行为组合
    /// </summary>
    [Class(Table = "IceZero_OperationActionCombo")]
    public class OperationActionCombo : ModelBase
    {
        /// <summary>
        /// 行为组编码，一般以正向行为作为名称，方便理解，如 combo_view ,blog.like
        /// </summary>
        [Property(Column = "ActionComboCode", TypeType = typeof(string), Length = 200, Unique = true)]
        public virtual string ActionComboCode { get; set; }
        /// <summary>
        /// 正向行为Id
        /// </summary>
        [Property(Column = "PositiveActionId", TypeType = typeof(string), Length = 200)]
        public virtual string PositiveActionId { get; set; } = string.Empty;
        /// <summary>
        /// 反向行为Id,只有 IsMutexAction 为 True 的时候才生效
        /// </summary>
        [Property(Column = "OppositeActionId", TypeType = typeof(string), Length = 200)]
        public virtual string OppositeActionId { get; set; } = string.Empty;

        /// <summary>
        /// 是否行为组里面的动作能循环调用,默认动作列表都可以循环调用,否则只能调用一次
        /// </summary>
        /// 
        [Property(Column = "IsLoop", TypeType = typeof(bool))]
        public virtual bool IsLoop { get; set; } = true;
        /// <summary>
        /// 是否是互斥行为，如果不是互斥行为，OppositeActionId 无效
        /// </summary>
        [Property(Column = "IsMutexAction", TypeType = typeof(bool))]
        public virtual bool IsMutexAction { get; set; } = false;
        /// <summary>
        /// 备注
        /// </summary>
        [Property(Column = "Remark", TypeType = typeof(string), Length = 200)]
        public virtual string Remark { get; set; }
    }
}
